package com.www;
import java.awt.*;
import javax.swing.*;
public class GUI_5 {
    private static void createAndShowGUI(){
        JFrame f = new JFrame("GridLayout");
        f.setLayout(new GridLayout(3,3));
        f.setSize(500,500);
        f.setLocation(700,200);
        for(int i = 1;i <= 9;i++){
            Button btn = new Button(""+i);
            f.add(btn);
        }
        f.setVisible(true);
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    }

    public static void main(String[] args) {
        SwingUtilities.invokeLater(GUI_5::createAndShowGUI);
    }
}
